import React from "react";
import './MyHeader.css'
export default class MyHeader extends React.Component {
    state = {
        bol: false
    }
    render () {
        const { nums, numbers } = this.props
        console.log(nums);
        console.log(JSON.parse(localStorage.getItem('bol')))
        // let bbol = this.state.bol
        if (localStorage.getItem('bol')) {
            this.state.bol = JSON.parse(localStorage.getItem('bol'))
            localStorage.removeItem('bol')
        }
        const age = () => {
            this.state.bol = !this.state.bol
        }

        // this.state.bol = true

        console.log(this.state.bol);
        return (
            <>
                <div className="liao">
                    <span><input type="checkbox" onChange={() => age()} onClick={() => this.props.bol(!this.state.bol)} checked={this.state.bol} name="" id="" /></span>
                    <span>价格:{nums}</span>
                    <span>结算({numbers})</span>
                </div>
            </>
        )
    }
}